package com.my.cd.factory.abstractFactory;

import com.my.cd.factory.pizza.NYCheesePizza;
import com.my.cd.factory.pizza.NYPepperPizza;
import com.my.cd.factory.pizza.Pizza;

/**
 * 抽象工厂的具体实现：纽约披萨工厂
 */
public class NYFactory implements AbstractFactory {

    @Override
    public Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equals("cheese")) {
            pizza = new NYCheesePizza();
        } else if (orderType.equals("pepper")) {
            pizza = new NYPepperPizza();
        }
        return pizza;

    }

}
